<template>
    <div>
        <el-breadcrumb separator-class="el-icon-arrow-right" style="padding-left: 10px;padding-bottom: 10px;font-size: 12px;">
            <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>挂号预约</el-breadcrumb-item>
            <el-breadcrumb-item>我的信息</el-breadcrumb-item>
        </el-breadcrumb>

        <el-card style="height: 145px">
         <el-col :span="4">
           <div class="demo-image__preview">
             <el-image 
              style="width: 80px; height: 100px"
              :src="userInfo[0].avatar" 
              :preview-src-list="srcList">
             </el-image>
           </div>
         </el-col>
         <el-col :span="20">
              <el-table
                :data="userInfo"
                style="width: 100%">
                <!-- 姓名 -->
                <el-table-column
                label="姓名"
                width="100">
                <template slot-scope="scope">
                    <!-- <el-popover trigger="hover" placement="top"> -->
                    <!-- <p>姓名: {{ scope.row.name }}</p>
                    <p>住址: {{ scope.row.address }}</p> -->
                    <div slot="reference" class="name-wrapper">
                        <el-tag size="medium">{{ scope.row.userName }}</el-tag>
                    </div>
                    <!-- </el-popover> -->
                </template>
                </el-table-column>
                <!-- 性别 -->
                 <el-table-column
                label="性别"
                width="80">
                <template slot-scope="scope">
                    <!-- <i class="el-icon-time"></i> -->
                    <!-- <span style="margin-left: 1px">{{ scope.row.gender }}</span> -->
                    <el-tag type="success" effect="plain">{{ scope.row.gender==1?'男':( scope.row.gender==0?'女':'保密') }}</el-tag>
                </template>
                </el-table-column>
                <!-- 年龄 -->
                 <el-table-column
                label="年龄"
                width="100">
                <template slot-scope="scope">
                    <span style="margin-left: 1px">{{ scope.row.age }}</span>
                </template>
                </el-table-column>
                <!-- 联系方式 -->
                <el-table-column
                    prop="place"
                    label="问诊地点"
                    width="150">
                    <template slot-scope="scope">
                        <span ><i class="el-icon-location"></i>{{scope.row.place}}</span>
                    </template>
                    </el-table-column>
                 <el-table-column
                label="科室"
                width="100">
                <template slot-scope="scope">
                    <span style="margin-left: 1px">{{ scope.row.departmentName }}</span>
                </template>
                </el-table-column>
                 <el-table-column
                label="门诊时间"
                width="100">
                <template slot-scope="scope">
                    <span style="margin-left: 1px">{{ scope.row.appointment }}</span>
                </template>
                </el-table-column>
                <!-- 密码 -->
                 <el-table-column
                label="密码"
                width="100">
                <template slot-scope="scope">
                    <span style="margin-left: 1px">{{ scope.row.password }}</span>
                </template>
                </el-table-column>
                
                
                <!-- <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button
                    size="mini"
                    type="success"
                    @click="handleEdit(scope.$index, scope.row)">修改</el-button>
                    
                </template>
                </el-table-column> -->
            </el-table>
         </el-col>
        </el-card>
        <el-card style="margin-top: 10px; height: 500px" >
            <h1>医疗特长</h1>
            <p class="content1">{{ userInfo[0].speciality}}</p>
            <el-divider></el-divider>
            <h1>个人简介</h1>
            <p class="content1">{{ userInfo[0].introduction}}</p>
            

        </el-card>
    </div>
</template>

<script>
import {getUserInfo} from '../../api/login'

export default {
    data() {
        return {
        // tableData: [{
        //   departmentName: '神经内科',
        //   appointment: '周二上午',
        //   age: '24',
        //   password: '123456',
        //   gender: '1',
        //   date: '2016-05-02',
        //   name: '王小龙',
        //   address: '上海市普陀区金沙江路 1518 弄'
        // }]
        userInfo: [],
        srcList: []

        }
    },
    methods: {
        async getUserInfo() {
                console.log("加载用户信息.........");
                const res = await getUserInfo();
                console.log(res);
                //this.userInfo[0] = res.data.data.userInfo;
                this.userInfo.push(res.data.data.userInfo);
                this.srcList.push(res.data.data.userInfo.avatar)
                console.log("userInfo为：")
                console.log(this.userInfo);
            },
    },
      mounted(){
            this.getUserInfo();
        },

    
}
</script>

<style>
.content1{
     /* font-family: "KaiTi"; */
    font-weight: 400;
    /* word-spacing:10px; */
    /* 字间距 */
    letter-spacing: 1.5px;
    line-height:140%;
    font-size: 4mm;
}

</style>